﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    public class CustomException : Exception
    {
        string _customMessage = "";

        public CustomException()
        {
            
        }

        public string CustomMessage
        {
            get
            {
                return _customMessage;
            }

            set
            {
                _customMessage = value;
            }
        }

        public override string Message
        {
            get
            {
                return this.CustomMessage;
            }
        }
    }
    public class FileNotFoundException : CustomException
    {

        public override string Message
        {
            get
            {
                return string.IsNullOrEmpty(base.CustomMessage) ? "文件未找到，请检查文件名是否正确或路径正确性！" : base.CustomMessage;
            }
        }
    }
    public class ConnectServerFailedException : CustomException
    {
        public override string Message
        {
            get
            {
                return string.IsNullOrEmpty(base.CustomMessage) ? "连接服务器失败，请联系管理员！" : base.CustomMessage;
            }
        }
    }

    public class XMLParsingFailedException : CustomException
    {
        public override string Message
        {
            get
            {
                return string.IsNullOrEmpty(base.CustomMessage) ? "XML内容解析失败！" : base.CustomMessage; ;
            }
        }
    }

    public class LoadXMLFailedException : CustomException
    {
        public override string Message
        {
            get
            {
                return string.IsNullOrEmpty(base.CustomMessage) ? "加载XML失败！" : base.CustomMessage; ;
            }
        }
    }

    public class KillProcessFailedException : CustomException
    {
        public override string Message
        {
            get
            {
                return string.IsNullOrEmpty(base.CustomMessage) ? "进程释放失败！" : base.CustomMessage; ;
            }
        }
    }

    public class StartProcessFailedException : CustomException
    {
        public override string Message
        {
            get
            {
                return string.IsNullOrEmpty(base.CustomMessage) ? "启动进程失败！" : base.CustomMessage; ;
            }
        }
    }
}
